import 'vue-tabs/vue-tabs.css'
import Vue from 'vue'
import VueTaber from 'vue-tabs'

import {
	menu
} from '@utils/config'

Vue.use(VueTaber)

let {
	MU_1,
	DE_2,
	SR_3,
	UA_4,
} = menu

const tabs = [{
	// 首页
	name: "main",
	title: "首页",
	component: resolve => require(['@views/modules/Main.vue'], resolve),
	// component: resolve => require(['@views/modules/tab1.vue'], resolve),
	beforeClose(tab, next) {

	},
	beforeCreate(tab, next) {
		console.log('before create:', tab)
		// console.log(this.$router.push('/home/de'))
		next()
	},
}, {
	// 物料上传
	name: MU_1.name,
	title: MU_1.text,
	component: resolve => require(['@views/modules/MateralUpload.vue'], resolve),
}, {
	// 数据编辑
	name: DE_2.name,
	title: DE_2.text,
	component: resolve => require(['@views/modules/DataEditor.vue'], resolve),
}, {
	// 统计报告
	name: SR_3.name,
	title: SR_3.text,
	component: resolve => require(['@views/modules/DataEditor.vue'], resolve),
}, {
	// 账号管理
	name: UA_4.name,
	title: UA_4.text,
	component: resolve => require(['@views/modules/DataEditor.vue'], resolve),
}]

export default new VueTaber({
	tabs,
	// persist: true,
})